package com.zjuee.base.dto.common.warning;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zjuee.base.base.Converter;
import com.zjuee.base.bean.Pages;
import com.zjuee.base.warning.AlarmPrompt;
import lombok.*;
import org.springframework.beans.BeanUtils;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class AlarmPromptDto extends AlarmPrompt implements Converter<AlarmPrompt, AlarmPromptDto> {

    private Pages page;

    //查询用的开始时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    //查询用的结束时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    //公司名字
    private String bciName;

    //行政区划(省)
    private String bciProvince;

    //行政区划(市)
    private String bciCity;


    //行政区划(区/县)
    private String bciArea;

    //行政区划(街道)
    private String bciStreet;

    @Override
    public void convertToDo(AlarmPrompt alarmPrompt) {
        BeanUtils.copyProperties(this,alarmPrompt);
    }

    @Override
    public AlarmPromptDto convert(AlarmPrompt alarmPrompt) {
        BeanUtils.copyProperties(alarmPrompt,this);
        return this;
    }
}
